#pragma once
#include "..\Shared\Plugin.h"
#include <iostream>
#include <fstream>
#include <string>

class ContentIOPlugin : public PluginBase
{
public:
	ContentIOPlugin();

	bool __stdcall HandleCommand(Command &NewCommand);
protected:
private:
	bool CheckValid(Command &NewCommand, int numberOfArguments);
	void SaveObject(std::string, const std::string, const std::string, int Tabs=0);
	void LoadObject(std::string);
	void ItemFactory(Command &NewCommand);
};

class FileIO
{
public:
	FileIO();
	void OpenFile(std::string);
	std::string ReadFile();
	void WriteFile(std::string, const Value &, const std::string, const std::string, int Tabs=0); //(file name,  attribute, file mode, object name)
	void CloseFile();
	~FileIO();
private:
	std::string fileName;
	std::ofstream *WritePtr;
	std::ifstream *LoadPtr;
	int OverWriteCount;

};

